﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddUserProject.aspx.cs" Inherits="lcs.Web.supply.AddUserProject" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../css/myStyle.css" rel="stylesheet" />
    <link href="../style.css" type="text/css" rel="stylesheet" />
      <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#txt_proName").autocomplete({
                 minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../supply/Handler1.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 //var a = item;
                                 return { label: item, value: item };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
</head>
<body style="font-size:10pt">
    <form id="form1" runat="server">
        <div>
            <table cellspacing="0" cellpadding="0" width="100%" border="0">
                <tr>
                    <td height="25" width="30%" align="right">&nbsp;</td>
                    <td height="25" width="*" align="left">
                        <asp:Label ID="lblid" runat="server" Visible="False"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td height="25" width="30%" align="right">项目名称
	：</td>
                    <td height="25" width="*" align="left">
                        <asp:TextBox ID="txt_proName" runat="server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td height="25" width="30%" align="right">材料员
	：</td>
                    <td height="25" width="*" align="left">
                        <asp:DropDownList ID="ddl_clyUser" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td height="25" width="30%" align="right">&nbsp;</td>
                    <td height="25" width="*" align="left">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td height="25" width="30%" align="right">&nbsp;</td>
                    <td height="25" width="*" align="left">
                <asp:Button ID="btnSave" runat="server" Text="保存"
                    OnClick="btnSave_Click" class="inputbutton" CssClass="btn"></asp:Button>
                    </td>
                </tr>
            </table>

            </td>
        </tr>
        <tr>
            <td class="tdbg" align="center" valign="bottom">
            </td>
        </tr>
            </table>
        </div>
    </form>
</body>
</html>
